﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuanLyCuaHangBanMayTinh.He_Thong_Du_Lieu;

namespace QuanLyCuaHangBanMayTinh.He_Thong_Xu_Ly
{
    class NguoiDungBUS
    {
        public static bool ThemNguoiDung(NguoiDungDTO nd)
        {
            if (NguoiDungDAO.SelectmhByName(nd.TenNguoiDung) == null)
            {
                NguoiDungDAO.Insert(nd);
                return true;
            }
            else
            {
                return false;
            }
        }

        public static bool XoaNguoiDung(NguoiDungDTO nd)
        {
            if (NguoiDungDAO.SelectmhByName(nd.TenNguoiDung) == null)
            {
                NguoiDungDAO.Delete(nd);
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
